﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Bind.View
{
    /// <summary>
    /// DemoView.xaml 的交互逻辑
    /// </summary>
    public partial class DemoView : UserControl
    {
        private ViewModel.DemoViewModel DemoViewModel = new ViewModel.DemoViewModel();
        public DemoView()
        {
            InitializeComponent();
            this.DataContext = DemoViewModel;
            DemoViewModel.Order = "4500031541";
            DemoViewModel.BarCode = "G21110401417";
            DemoViewModel.State = "测试通过";
            DemoViewModel.StateColor = Brushes.ForestGreen;
            DemoViewModel.Count = "197/500";
            DemoViewModel.Percent = 197 * 100 / 500.0;
            DemoViewModel.Pass[0] = 27;
            DemoViewModel.Fail[0] = 2;
        }

        private void Label_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            DemoViewModel.Order = "订单";
        }

        private void Border_MouseMove(object sender, MouseEventArgs e)
        {
            this.Cursor = Cursors.Hand;
        }

        private void Border_MouseLeave(object sender, MouseEventArgs e)
        {
            this.Cursor = Cursors.Arrow;
        }

    }
}
